home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_04
/
1004092b
< prev
next >
Wrap
Text File
|
1992-02-08
|
543b
|
47 lines
main()
{
node n;
n.value.d = 9.87;
n.type = Double;
push(n);
n.value.s = "some text";
n.type = String;
push(n);
n.value.i = 123;
n.type = Int;
push(n);
n.value.c = 'A';
n.type = Char;
push(n);
while (n = pop(), n.type != Error) {
switch (n.type) {
case Char:
printf("Char = %c\n", n.value.c);
break;
case Int:
printf("Int = %d\n", n.value.i);
break;
case Double:
printf("Double = %f\n", n.value.d);
break;
case String:
printf("String = %s\n", n.value.s);
break;
}
}
return 0;
}